﻿using System.ComponentModel;

namespace Utility
{
    /// <summary>
    /// 返回结果定义类
    /// 创建者  蒋新威
    /// 创建时间： 2020-05-27
    /// </summary>
    public enum ResultCode : int
    {
        #region  通用错误码
        /// <summary>
        /// 接口调用异常
        /// </summary>
        [Description("接口调用异常")]
        Exception = -1,

        /// <summary>
        /// 业务调用异常
        /// </summary>
        [Description("业务调用异常")]
        BusinessException = -100,


        /// <summary>
        /// 数据调用异常
        /// </summary>
        [Description("数据调用异常")]
        DataException = -10000,

        /// <summary>
        /// 成功
        /// </summary>
        [Description("成功")]
        Success = 200,

        /// <summary>
        /// 分页信息未定义
        /// </summary>
        [Description("分页信息未定义")]
        UnSetPage = 1,

        /// <summary>
        /// 每页记录数未定义
        /// </summary>
        [Description("每页记录数未定义")]
        UnSetPageSize = 2,

        /// <summary>
        /// 请求参数为空
        /// </summary>
        [Description("参数为空")]
        NullReqest = 3,

        /// <summary>
        /// 请求参数无效
        /// </summary>
        [Description("请求参数无效")]
        InvalidReqest = 4,

        /// <summary>
        /// 请求无数据返回
        /// </summary>
        [Description("请求无数据返回")]
        NoData = 5,

        /// <summary>
        /// 失败
        /// </summary>
        [Description("失败")]
        Fail = 500,

        /// <summary>
        /// 数据操作错误-请求终止
        /// </summary>
        [Description("请求终止")]
        Forbidden = 403,
        #endregion

        #region 登录身份相关
        /// <summary>
        /// Portal平台登录失败
        /// </summary>
        [Description("Portal平台登录失败")]
        PortalLoginFail = 1000403,

        /// <summary>
        /// 登录信息丢失
        /// </summary>
        [Description("登录信息丢失")]
        LoginInfoLose = 1000401,

        /// <summary>
        /// 登录失败
        /// </summary>
        [Description("登录失败")]
        LoginFail = 1000402,

        /// <summary>
        /// 登录失败
        /// </summary>
        [Description("登录失败")]
        LoginException = 1000400,

        /// <summary>
        /// 无效登录信息
        /// </summary>
        [Description("无效登录信息")]
        LoginInvalid = 1000404,

        /// <summary>
        /// 密码错误
        /// </summary>
        [Description("密码错误")]
        PassWordError = 1000405,

        /// <summary>
        /// token失效
        /// </summary>
        [Description("token失效")]
        TokenInvalid = 1000406,
        #endregion

        #region 权限相关
        /// <summary>
        /// 没有权限
        /// </summary>
        [Description("没有权限")]
        PermissionInvalid = 2000400,
        /// <summary>
        /// 角色禁用
        /// </summary>
        [Description("角色禁用")]
        RoleForbidden = 2000401,
        /// <summary>
        /// 没有角色
        /// </summary>
        [Description("没有角色")]
        NullRole = 2000401,
        #endregion
    }
}
